import request from '@/utils/request'
import {AddResponse} from '@/api/notice/type'

enum API {
  NOTICEINFOLIST_URL = '/mobile/notificationListPage/',
  GETNOTIFICATIONBYTITLE_URL = '/mobile/getNotificationByTitleInfoPage/',
  ADDNOTIFICATIONINFO = '/mobile/addNotificationForAllParents/',
  DELETENOTIFICATIONBYIDS = '/mobile/batchNotificationByIds?notificationArr=',
  DELETENOTIFICATIONBYID = '/mobile/deleteNotificationById'
}
export const reqNoticeInfoList = (currentPage: number, limit: number) => request.get(API.NOTICEINFOLIST_URL + `${currentPage}/${limit}`)
export const reqNoticeBytitleInfoPage = (currentPage: number, limit: number, title: String) => request.get(API.GETNOTIFICATIONBYTITLE_URL + `${currentPage}/${limit}/${title}`)

//添加
export const addOrUpdatNotificationInfo =(NoticePageInfo:any)=>
    request.post<any,AddResponse>(API.ADDNOTIFICATIONINFO,NoticePageInfo)


// 批量删除
export const DeleteNoTifIcationByIds = (ids:any)=>
request.delete<any,AddResponse>(API.DELETENOTIFICATIONBYIDS + `${ids}`)

//单删除
export const DeleteNoTifIcationById = (Item:any)=>
request.post(API.DELETENOTIFICATIONBYID , Item)